/*
 * Navigator.hpp
 *
 *  Created on: 18 jan. 2013
 *      Author: Admin
 */

#ifndef NAVIGATOR_HPP_
#define NAVIGATOR_HPP_

class Navigator
{
public:
	enum Direction { CROSSINTERSECTION, TURNLEFT, TURNRIGHT };

	static Navigator& getInstance()
	{
		static Navigator navigator;
		return navigator;
	}

	Direction getNextDirection()
	{
		if (counter == 9)
			counter = 0;
		return path[counter++];
	}

	bool hasPath()
	{
		return 1;
	}

	void restart()
	{
		counter = 0;
	}

private:
	char counter ;
	Direction path[10];
	Navigator() : counter(0)
	{
//		path[0] = TURNRIGHT;
//		path[1] = CROSSINTERSECTION;
//		path[2] = TURNRIGHT;
//		path[3] = TURNRIGHT;
//		path[4] = TURNLEFT;
//		path[5] = TURNLEFT;
//		path[6] = CROSSINTERSECTION;
//		path[7] = TURNLEFT;

		path[0] = TURNRIGHT;
		path[1] = TURNRIGHT;
		path[2] = TURNLEFT;
		path[3] = TURNRIGHT;
		path[4] = TURNLEFT;
		path[5] = TURNLEFT;
		path[6] = TURNLEFT;
//		path[7] = TURNLEFT;
	}
};


#endif /* NAVIGATOR_HPP_ */
